package com.infoland.afanmall.model.my.adapter;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.infoland.afanmall.R;
import com.infoland.afanmall.model.my.entity.KeFu;

import java.util.List;

/**
 * @author 王永吉
 * @date 2018/7/23 15:23
 */
public class KeFuAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity, BaseViewHolder> {

    public KeFuAdapter(List<MultiItemEntity> data) {
        super(data);
        addItemType(KeFu.TIME, R.layout.ke_fu_time);
        addItemType(KeFu.LEFT, R.layout.ke_fu_left);
        addItemType(KeFu.RIGHT, R.layout.ke_fu_right);
    }

    @Override
    protected void convert(BaseViewHolder helper, MultiItemEntity item) {
        switch (helper.getItemViewType()) {
            case KeFu.TIME:
                if (helper.getAdapterPosition() == 0) {
                    helper.setText(R.id.text, " 06月03日 13:08");
                }
                break;
            case KeFu.LEFT:
                if (helper.getAdapterPosition() == 1) {
                    helper.setText(R.id.text, "您好");
                }
                break;
            case KeFu.RIGHT:
                if (helper.getAdapterPosition() == 2) {
                    helper.setText(R.id.text, "您好");
                }
                break;

        }

    }
}
